//
//  ShowAppInfoVC.m
//  IconDemo
//
//  Created by LM on 2019/9/29.
//  Copyright © 2019 TJ. All rights reserved.
//

#import "ShowAppInfoVC.h"

@interface ShowAppInfoVC ()

@property (nonatomic, strong) UIButton *closeBtn;

@property (nonatomic, strong) UIImageView *bgImage;

@property (nonatomic, strong) UIImageView *appIcon;

@end

@implementation ShowAppInfoVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.bgImage = [UIImageView new];
    self.bgImage.image = [UIImage imageNamed:@"应用页"];
    [self.view addSubview:self.bgImage];
    UIEdgeInsets padding = UIEdgeInsetsMake(0, 0, 0, 0);
    [self.bgImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view).with.insets(padding);
    }];
    
    self.closeBtn = [UIButton buttonWithType:UIButtonTypeSystem];
//    [self.closeBtn setTitle:@"关闭" forState:UIControlStateNormal];
//    self.closeBtn.backgroundColor = [UIColor whiteColor];
    [self.closeBtn addTarget:self action:@selector(closeClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.closeBtn];
    [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self.view.mas_bottom);
        make.right.mas_equalTo(self.view.mas_right);
        make.left.mas_equalTo(self.view.mas_left);
        make.height.mas_equalTo(48);
    }];
    
    self.appIcon = [[UIImageView alloc] initWithImage:self.photoImage];
    self.appIcon.layer.masksToBounds = YES;
    self.appIcon.layer.cornerRadius = 23;
    self.appIcon.backgroundColor = [UIColor redColor];
    self.appIcon.alpha = 1;
    [self.view addSubview:self.appIcon];
    [self.appIcon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.view.mas_top).with.offset(79);
        make.left.mas_equalTo(self.view.mas_left).with.offset(15);
        make.width.mas_equalTo(100);
        make.height.mas_equalTo(100);
    }];
}

- (void)closeClick
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
